<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <style>
        
        </style>
        
        </h:head>
    <h:body>
       <div id="col-top"></div>
    <div id="col" >
       
        <h:outputText value="#{msg['label.selected.col']}" ></h:outputText>
        <p:selectOneMenu value="#{beancontroler_.idcolaboradorselected}" style="margin-left: 2%">
            <f:selectItem itemValue="0" itemLabel="[Seleccione Colaborador]"/>
            <f:selectItems value="#{beancontroler_.colaborador}"/>
        </p:selectOneMenu><br/><br/>
        <h:outputText value="#{msg['label.selected.dialibre']}"/>
        <p:calendar label="#{msg['label.selected.dialibre']}" required="true" mindate="#{beancontroler_.limitdate}"   style="margin-left:11%" pattern="dd/MM/yyyy" value="#{beancontroler_.date3}" id="popupButtonCal" showOn="button" >  
            
            <p:ajax event="dateSelect" listener="#{beancontroler_.handleDateSelect}" update="growl ,add,updateco,viewCommand " />  
        </p:calendar><br/>
        
        <br/>
         
        <p:commandButton style="margin-left: 16%;" rendered="#{beancontroler_.permisocreate}" disabled="#{beancontroler_.rederedservicesadd}" id="add" icon="ui-icon-plusthick " update="@form" action="#{beancontroler_.agregardialibrecolaborador()}" value="#{msg['label.add.dia']}"/>
        <p:commandButton style="margin-left: 1%;"  update="@form" rendered="#{beancontroler_.permisodelte}" disabled="#{beancontroler_.renderedservicesdelete}"  action="#{beancontroler_.eliminardialibre()}"    id="viewCommand" value="#{msg['label.delete.dia']}" icon="ui-icon-trash" />
        <p:commandButton style="margin-left: 1%;"  update="@form" rendered="#{beancontroler_.permisoupdate}" disabled="#{beancontroler_.renderedservicesupdate}"  icon="ui-icon-disk "  action="#{beancontroler_.actualizardiaslibre()}"   id="updateco" value="#{msg['label.upate.dia']}"  /><br/><br/>
        
        <br/><br/>
         <p:inputText id="serch"  style="width: 570px;margin-left: 16%;background-image: url('icons/zoom.png');background-repeat: no-repeat;padding: 3px 3px 3px 25px; background-position: 4px 1px;    " value="#{beancontroler_.filltext}">
            <p:ajax event="keyup" update="dataTable" listener="#{beancontroler_.filterdialibre()}" />  
        </p:inputText>
        <p:dataTable   paginatorPosition="bottom" rowKey="#{comp.id}" selection="#{beancontroler_.selecteddiascol}"  selectionMode="single" style="width:600px;margin-left: 16%;" id="dataTable" var="comp" value="#{beancontroler_.listdias}"  
                 paginator="true" rows="10"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15">  
            <p:ajax event="rowSelect"   update="@none"  oncomplete="updateContent()"   listener="#{beancontroler_.modificardialibre()}"/>
        <f:facet name="header">  
         #{msg['label.list.dias']}
        </f:facet>  
  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="#{msg['label.name.coldias']}" />  
            </f:facet>  
            <h:outputText value="#{comp.fkCol.nombrecompleto}" />  
        </p:column>  
  
             <p:column>  
            <f:facet name="header">  
                <h:outputText value="#{msg['label.dialibrecol']}" />  
            </f:facet>  
                 <h:outputText value="#{comp.fecha}" >  
                     <f:convertDateTime pattern="dd/MM/yyyy"/>
                 </h:outputText>
        </p:column> 
    </p:dataTable>  
        
        
        
        
       
    
    </div> <!-- /col -->
    <div id="col-bottom"></div>
    </h:body>
</html>
